using System;
using System.ComponentModel.Design;
using System.Diagnostics;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;

namespace OpenComposite.EII
{
	/// <summary>
	/// Hosts the RepositorySurface which inherits from DesignSurface.
	/// </summary>
	public partial class RepositoryContent : DockContent
	{
		#region Initialization
		public RepositoryContent(RepositorySurface surface)
		{
			InitializeComponent();
			Init(surface);
		}
		internal void Init(RepositorySurface surface)
		{
			try {
				if ( surface == null )
					return;

				_surface = surface;

				Control control = _surface.View as Control;

				control.Parent = this;
				control.Dock = DockStyle.Fill;
				control.Visible = true;
			} catch ( Exception ex ) {
				Trace.WriteLine(ex.ToString());
			}
		}
		#endregion

		#region Public Members

		#region Properties
		public RepositorySurface Surface
		{
			get
			{
				return _surface;
			}
		}
		public IDesignerHost DesignerHost
		{
			get
			{
				return (IDesignerHost)_surface.GetService(typeof(IDesignerHost));
			}
		}
		#endregion

		#region Events
		#endregion

		#region Methods
		#endregion

		#endregion

		#region Private Members

		#region Variables
		private RepositorySurface _surface;
		#endregion

		private void RepositoryContent_MouseMove(object sender, MouseEventArgs e)
		{

		}

		private void RepositoryContent_MouseUp(object sender, MouseEventArgs e)
		{

		}

		#region Methods
		#endregion

		#region Event Handlers
		#endregion

		#endregion
	}
}